GHashTableIter hashiter;
gpointer hashkey, hashvalue;
GString *buf = g_string_new ("");
- gs_unref_bytes GBytes *bytes = NULL;
+ g_autoptr(GBytes) bytes = NULL;
guint i;
gs_unref_hashtable GHashTable *written_overrides = NULL;
new_config_contents = _ostree_sysroot_join_lines (new_lines);
{
- gs_unref_bytes GBytes *new_config_contents_bytes =
+ g_autoptr(GBytes) new_config_contents_bytes =
g_bytes_new_static (new_config_contents,
strlen (new_config_contents));
new_config_contents = _ostree_sysroot_join_lines (new_lines);
{
- gs_unref_bytes GBytes *new_config_contents_bytes =
+ g_autoptr(GBytes) new_config_contents_bytes =
g_bytes_new_static (new_config_contents,
strlen (new_config_contents));
gpointer user_data)
{
OstreeFetcherPendingURI *pending = user_data;
- gs_unref_bytes GBytes *bytes = NULL;
+ g_autoptr(GBytes) bytes = NULL;
gsize bytes_read;
GError *local_error = NULL;
GError **error = &local_error;
if (repo_mode == OSTREE_REPO_MODE_BARE_USER && object_is_symlink)
{
const char *target_str = g_file_info_get_symlink_target (file_info);
- gs_unref_bytes GBytes *target = g_bytes_new (target_str, strlen (target_str) + 1);
+ g_autoptr(GBytes) target = g_bytes_new (target_str, strlen (target_str) + 1);
/* For bare-user we can't store symlinks as symlinks, as symlinks don't
support user xattrs to store the ownership. So, instead store them
GError **error)
{
gboolean ret = FALSE;
- gs_unref_bytes GBytes *bytes = NULL;
+ g_autoptr(GBytes) bytes = NULL;
g_autofree char *ret_contents = NULL;
gsize len;
gs_unref_variant GVariant *commit_data = NULL;
guint64 commit_size;
gs_unref_variant GVariant *commit_csum_v = NULL;
- gs_unref_bytes GBytes *commit_bytes = NULL;
+ g_autoptr(GBytes) commit_bytes = NULL;
int i;
if (!ot_variant_bsearch_str (refs, ref, &i))
{
GMappedFile *mfile = NULL;
- gs_unref_bytes GBytes *delta_data = NULL;
+ g_autoptr(GBytes) delta_data = NULL;
mfile = g_mapped_file_new_from_fd (fd, FALSE, error);
if (!mfile)
{
gboolean ret = FALSE;
g_autofree char *meta_path = _ostree_get_relative_static_delta_detachedmeta_path (from_revision, checksum);
- gs_unref_bytes GBytes *detached_meta_data = NULL;
+ g_autoptr(GBytes) detached_meta_data = NULL;
SoupURI *target_uri = NULL;
gs_unref_variant GVariant *metadata = NULL;
gs_unref_variant GVariant *ret_delta_superblock = NULL;
g_autofree char *delta_name =
_ostree_get_relative_static_delta_superblock_path (from_revision, to_revision);
- gs_unref_bytes GBytes *delta_superblock_data = NULL;
- gs_unref_bytes GBytes *delta_meta_data = NULL;
+ g_autoptr(GBytes) delta_superblock_data = NULL;
+ g_autoptr(GBytes) delta_meta_data = NULL;
gs_unref_variant GVariant *delta_superblock = NULL;
SoupURI *target_uri = NULL;
if (pull_data->is_mirror && !refs_to_fetch && !configured_branches)
{
SoupURI *summary_uri = NULL;
- gs_unref_bytes GBytes *bytes = NULL;
+ g_autoptr(GBytes) bytes = NULL;
g_autofree char *ret_contents = NULL;
summary_uri = suburi_new (pull_data->base_uri, "summary", NULL);
gboolean ret = FALSE;
g_autofree char *tmpname = g_strdup ("tmpostree-deltaobj-XXXXXX");
gs_fd_close int fd = -1;
- gs_unref_bytes GBytes *ret_content = NULL;
+ g_autoptr(GBytes) ret_content = NULL;
g_autoptr(GInputStream) istream = NULL;
g_autoptr(GFileInfo) ret_finfo = NULL;
g_autoptr(GOutputStream) out = NULL;
gboolean ret = FALSE;
gs_unref_hashtable GHashTable *from_bsdiff = NULL;
gs_unref_hashtable GHashTable *to_bsdiff = NULL;
- gs_unref_bytes GBytes *tmp_from = NULL;
- gs_unref_bytes GBytes *tmp_to = NULL;
+ g_autoptr(GBytes) tmp_from = NULL;
+ g_autoptr(GBytes) tmp_to = NULL;
g_autoptr(GFileInfo) from_finfo = NULL;
g_autoptr(GFileInfo) to_finfo = NULL;
ContentBsdiff *ret_bsdiff = NULL;
gboolean ret = FALSE;
gs_unref_hashtable GHashTable *from_rollsum = NULL;
gs_unref_hashtable GHashTable *to_rollsum = NULL;
- gs_unref_bytes GBytes *tmp_from = NULL;
- gs_unref_bytes GBytes *tmp_to = NULL;
+ g_autoptr(GBytes) tmp_from = NULL;
+ g_autoptr(GBytes) tmp_to = NULL;
g_autoptr(GFileInfo) from_finfo = NULL;
g_autoptr(GFileInfo) to_finfo = NULL;
OstreeRollsumMatches *matches = NULL;
GBytes *operations_b;
g_autofree guchar *part_checksum = NULL;
g_autoptr(GChecksum) checksum = NULL;
- gs_unref_bytes GBytes *objtype_checksum_array = NULL;
- gs_unref_bytes GBytes *checksum_bytes = NULL;
+ g_autoptr(GBytes) objtype_checksum_array = NULL;
+ g_autoptr(GBytes) checksum_bytes = NULL;
g_autoptr(GFile) part_tempfile = NULL;
g_autoptr(GOutputStream) part_temp_outstream = NULL;
g_autoptr(GInputStream) part_in = NULL;
{
GMappedFile *mfile = gs_file_map_noatime (part_path, cancellable, error);
- gs_unref_bytes GBytes *bytes = NULL;
+ g_autoptr(GBytes) bytes = NULL;
if (!mfile)
goto out;
gboolean ret = FALSE;
gsize partlen;
const guint8*partdata;
- gs_unref_bytes GBytes *part_payload_bytes = NULL;
- gs_unref_bytes GBytes *payload_data = NULL;
+ g_autoptr(GBytes) part_payload_bytes = NULL;
+ g_autoptr(GBytes) payload_data = NULL;
gs_unref_variant GVariant *payload = NULL;
guint8 comptype;
{
guint32 mode;
gs_unref_variant GVariant *metadata = NULL;
- gs_unref_bytes GBytes *bytes = NULL;
+ g_autoptr(GBytes) bytes = NULL;
gs_fd_close int fd = -1;
bytes = ot_lgetxattrat (self->objects_dir_fd, loose_path_buf,
g_autoptr(GFile) tmp_signature_file = NULL;
g_autoptr(GOutputStream) tmp_signature_output = NULL;
gpgme_ctx_t context = NULL;
- gs_unref_bytes GBytes *ret_signature = NULL;
+ g_autoptr(GBytes) ret_signature = NULL;
gpgme_engine_info_t info;
gpgme_error_t err;
gpgme_key_t key = NULL;
GError **error)
{
gboolean ret = FALSE;
- gs_unref_bytes GBytes *commit_data = NULL;
- gs_unref_bytes GBytes *signature = NULL;
+ g_autoptr(GBytes) commit_data = NULL;
+ g_autoptr(GBytes) signature = NULL;
gs_unref_variant GVariant *commit_variant = NULL;
gs_unref_variant GVariant *old_metadata = NULL;
gs_unref_variant GVariant *new_metadata = NULL;
GError **error)
{
gboolean ret = FALSE;
- gs_unref_bytes GBytes *delta_data = NULL;
- gs_unref_bytes GBytes *signature_data = NULL;
+ g_autoptr(GBytes) delta_data = NULL;
+ g_autoptr(GBytes) signature_data = NULL;
gs_unref_variant GVariant *commit_variant = NULL;
g_autofree char *delta_path = NULL;
g_autoptr(GFile) delta_file = NULL;
gs_unref_variant GVariant *commit_variant = NULL;
g_autoptr(GFile) keyringdir_ref = NULL;
gs_unref_variant GVariant *metadata = NULL;
- gs_unref_bytes GBytes *signed_data = NULL;
+ g_autoptr(GBytes) signed_data = NULL;
g_autofree char *commit_filename = NULL;
/* Create a temporary file for the commit */
g_autoptr(GFile) origin_parent = g_file_get_parent (origin_path);
g_autofree char *contents = NULL;
gsize len;
- gs_unref_bytes GBytes *contents_bytes = NULL;
+ g_autoptr(GBytes) contents_bytes = NULL;
contents = g_key_file_to_data (origin, &len, error);
if (!contents)